<?php
	require_once '../functions.php';
	
	//error_reporting(E_NOTICE);
	include '../reader.php';
	
	$excel = new Spreadsheet_Excel_Reader();
	$excel->read('../values.xls');

	$arr = array();
	$bb = array();
	$openraise = array();
	$range = array();
	
	$x=1;
	
    while($x<=$excel->sheets[5]['numRows']) {
      $y=1;
      while($y<=$excel->sheets[5]['numCols']) {
        $cell = isset($excel->sheets[5]['cells'][$x][$y]) ? $excel->sheets[5]['cells'][$x][$y] : '';
        $arr[] = $cell;
        $y++;
      }
      $x++;
    }
    
    for($i = 0; $i < count($arr); $i+=3){
    	$bb[] = $arr[$i];
    	$openraise[] = $arr[$i+1];
    	$range[] = $arr[$i+2];
    }
    
    for($j = 0; $j < count($bb); $j++){
    	query("INSERT INTO callopenshove(bb,openraise,hands) VALUES('$bb[$j]','$openraise[$j]','$range[$j]')");
    }
?>